package javatest;

import java.io.ByteArrayOutputStream;

/**
 * @author sad
 */
public class ByteOutputStream extends ByteArrayOutputStream {

    public ByteOutputStream() {
    }

    public ByteOutputStream(int size) {
        super(size);
    }

    public void writeShort(short value) {
        write(value >> 8);
        write(value & 0xff);
    }

    public void writeInt(int value) {
        write((value >> 24) & 0xff);
        write((value >> 16) & 0xff);
        write((value >> 8) & 0xff);
        write((value) & 0xff);
    }

    public void writeByte(byte value) {
        write(value);
    }
}
